package com.lzh.media.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lzh.media.entity.WmUser;
import com.lzh.media.service.WmUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
    import com.lzh.core.controller.AbstractCoreController;

/**
* <p>
* 自媒体用户信息表 控制器</p>
* @author lzh
* @since 2021-06-24
*/
@RestController
@RequestMapping("/wmUser")
public class WmUserController extends AbstractCoreController<WmUser> {

    private WmUserService wmUserService;

    //注入
    @Autowired
    public WmUserController(WmUserService wmUserService) {
        super(wmUserService);
        this.wmUserService = wmUserService;
    }

    /**
     * 根据apUserId获取
     * @param id
     * @return
     */
    @GetMapping("/one")
    public WmUser getByUserId(@RequestParam(value = "id") Integer id) {
        QueryWrapper<WmUser> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("ap_user_id",id);
        WmUser wmUser = wmUserService.getOne(queryWrapper);
        return wmUser;
    }


}

